﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WPF_SFrost
{
    public partial class Main : Form
    {
        public Main()
        {
            InitializeComponent();
        }

        private void Main_Load(object sender, EventArgs e)
        {
            lblAD.Left = (this.Width - lblAD.Width) / 2;
            lblAD.Top = (this.Height - lblAD.Height) / 2;
            tsslblDate.Text = string.Format("现在日期：{0}。",DateTime.Now.ToLongDateString());
            tsslblUserName.Text = "欢迎 " + UserHelper.username + "，";
        }

        private void Main_FormClosed(object sender, FormClosedEventArgs e)
        {
            //MessageBox.Show("Closeed");
        }

        private void Main_FormClosing(object sender, FormClosingEventArgs e)
        {
            Application.Exit();
            //MessageBox.Show("Closing");
        }

        private void tsmiGroupList_Click(object sender, EventArgs e)
        {
            FormGroupList f = new FormGroupList();
            f.ShowDialog();
        }

        private void tsmiGroupAdd_Click(object sender, EventArgs e)
        {
            FormGroupAdd f = new FormGroupAdd();
            f.ShowDialog();
        }

        private void tsmiContactList_Click(object sender, EventArgs e)
        {
            FormContactList f = new FormContactList();
            f.ShowDialog();
        }

        private void tsmiContactAdd_Click(object sender, EventArgs e)
        {
            FormContactAdd f = new FormContactAdd();
            f.ShowDialog();
        }

        private void tsmiPwd_Click(object sender, EventArgs e)
        {
            FormPwdChange f = new FormPwdChange();
            f.ShowDialog();
        }

        private void tsmiDB_Click(object sender, EventArgs e)
        {
            FormDB f = new FormDB();
            f.ShowDialog();
        }

        private void tsmiAbout_Click(object sender, EventArgs e)
        {
            FormAbout f = new FormAbout();
            f.ShowDialog();
        }
    }
}
